<?php

require_once 'VO/Country.php';


// Define path to application directory
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/..'));

// Define application environment
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'doctrineCLI'));

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../library'),
    get_include_path()
)));


/** Zend_Application */
require_once 'Zend/Application.php';

// Create application, bootstrap, and run
$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/configs/application.ini'
);


$application->getBootstrap()->bootstrap('doctrine');
require_once('C:\wamp\www\FollowMyTrip\application\Bootstrap.php');
require_once('C:\wamp\www\FollowMyTrip\application\models\Base\Country.php');
require_once('C:\wamp\www\FollowMyTrip\application\models\Country.php');


$my_class = new DatabaseWrapper();
	$my_class->getCountries();

class DatabaseWrapper 
{
	
	/**
	 * Retrieve all the records from the table
	 * @return an array of VOAuthor
	 */
	public function getCountries() 
	{
//		$insert = new Model_Country();
//		$insert->id = 4;
//		$insert->name = "Serge";
//		$insert->save();

//		$q = Doctrine_Query::create()
//		    ->delete('Model_Country')
//		    ->addWhere('id = ?', 4);
//		$numDeleted = $q->execute();

//		$product = new Model_Country();
//		$product->set('id',1,true);
//		$product->set('name',3,true);
//		$product->replace();
		
		
		echo "dcsdcds";
		
		$conn = Doctrine_Manager::connection();  
    	$q = Doctrine_Query::create($conn)
                ->select('*')
                ->from('Model_Country');
		$ret = $q->fetchOne();
                
        echo $rets->ExportTo('xml');
		
		$ret = array();
		
	    while ($row = mysql_fetch_object($result, "VOQuestion")) 
	    {
			$ret[] = $row;
		}
		
		// free the memory used by the mysql handler
		mysql_free_result($result);
		// return the result
		return $ret;
	}
	
}
?>